# -*- coding: utf-8 -*-            
# @Author : lidong1227
# @Time : 2023/4/30 19:54
from abc import ABCMeta, abstractmethod


class Pay(metaclass = ABCMeta):
    @abstractmethod
    def pay(self, money):
        pass


class AliPay(Pay):

    def __init__(self, isHuaBei = False):
        self.isHuaBei = isHuaBei
    def pay(self, money):
        if self.isHuaBei:
            print(f"使用花呗支付 {money} 元")
        else:
            print(f"使用支付宝支付 {money} 元")

class WechatPay(Pay):
    def pay(self, money):
        print(f"使用微信支付 {money} 元")

class FactoryPay(metaclass=ABCMeta):
    @classmethod
    def payment(self):
        pass

class FactoryAliPay(FactoryPay):
    def payment(self):
        return AliPay()
class FactoryHuabei(FactoryPay):
    def payment(self):
        return AliPay(isHuaBei=True)

class FactoryWechat(FactoryPay):
    def payment(self):
        return WechatPay()


f = FactoryHuabei()
p = f.payment()
p.pay(33)
print('-----')
f = FactoryWechat()
p = f.payment()
p.pay(33)